package com.vincent.template.domain;

import com.vincent.template.commons.base.BaseIdEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * @author Vincent Wang
 * @date 2020/12/29 16:08
 */
@Entity
@Table(name = "sys_bind_auth_group_role",
        indexes = {@Index(name = "idx_roleId", columnList = "roleId")},
        uniqueConstraints = {@UniqueConstraint(name = "UK_authGroupId_roleId", columnNames = {"authGroupId","roleId"})})
public class SysBindAuthGroupRolePo extends BaseIdEntity {

    /**
     * 权限组ID
     */
    @Column(nullable = false)
    private Long authGroupId;

    /**
     * 角色ID
     */
    @Column(nullable = false)
    private Long roleId;

    public Long getAuthGroupId() {
        return authGroupId;
    }

    public void setAuthGroupId(Long authGroupId) {
        this.authGroupId = authGroupId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public SysBindAuthGroupRolePo() {
    }

    public SysBindAuthGroupRolePo(Long authGroupId, Long roleId) {
        this.authGroupId = authGroupId;
        this.roleId = roleId;
    }
}
